package com.smh.genericity.fanxingRemove;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;

/**
 * @description: 泛型擦除例子
 * @author: shenmhk
 * @create: 2020-10-23 14:08
 */
public class Test01 {

    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        ArrayList<Integer> list = new ArrayList<Integer>();
        list.add(1);

        list.getClass().getMethod("add", Object.class).invoke(list,"asd");
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    }

}
